package com.test32_网络编程.hello.client;

import java.net.Socket;
import java.util.Scanner;

public class HelloClient {

    /**
     * Socket，客户端
     */
    public static void main(String[] args) throws Exception {
        Socket client = new Socket("localhost", 9999);  // 设置服务器端的连接地址
        Scanner scanner = new Scanner(client.getInputStream());
        if (scanner.hasNext()) {
            System.out.println("【HelloClient】" + scanner.next());
        }
        client.shutdownInput();     // 全部输入完成之后再关闭客户端Socket
    }
}
